package com.examples.MessageBox;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;


public class MessageBox extends Activity {
	static int counter=0;
	static String separator=". ";
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		TextView txt = (TextView) findViewById(R.id.text);
		txt.setText(txt.getText() + "\n" + Integer.toString(counter++) + separator + "onCreate");
	}

	@Override
	protected void onStart() {
		super.onStart();
		// The activity is about to become visible.
		TextView txt = (TextView) findViewById(R.id.text);
		txt.setText(txt.getText() + "\n" + Integer.toString(counter++) + separator + "onStart");
	}

	@Override
	protected void onResume() {
		super.onResume();
		// The activity has become visible (it is now "resumed").
		TextView txt = (TextView) findViewById(R.id.text);
		txt.setText(txt.getText() + "\n" + Integer.toString(counter++) + separator + "onResume");
	}

	@Override
	protected void onPause() {
		super.onPause();
		// Another activity is taking focus (this activity is about to be
		// "paused").
		TextView txt = (TextView) findViewById(R.id.text);
		txt.setText(txt.getText() + "\n" + Integer.toString(counter++) + separator + "onPause");
	}

	@Override
	protected void onStop() {
		super.onStop();
		// The activity is no longer visible (it is now "stopped")
		TextView txt = (TextView) findViewById(R.id.text);
		txt.setText(txt.getText() + "\n" + Integer.toString(counter++) + separator + "onStop");
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		TextView txt = (TextView) findViewById(R.id.text);
		txt.setText(txt.getText() + "\n" + Integer.toString(counter++) + separator + "onDestroy");
		// The activity is about to be destroyed.
	}
}